<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>ActuStage</title>
	
</head>
<body>
<?php

include("classes/Administrateur.interface.php");
include("classes/Utilisateur.class.php");
include("classes/Etudiant.class.php");
include("classes/Professeur.class.php");
include("classes/RequeteSQL.class.php");
include("classes/bdd.php");
include("classes/Offre.class.php");
include("classes/Entreprise.class.php");

 //R�cup�ration des infos entreprise
 
$nomEnt = $_POST['fent'];
$ad1Ent = $_POST['fle1ad1'];
$ad2Ent = $_POST['fle1ad2'];
$cpEnt = $_POST['fle1codepostal'];
$villeEnt = $_POST['fle1ville'];
$mailEnt = $_POST['flemail'];
$telEnt = $_POST['fltel'];

//Cr�ation de l'objet Entreprise

$adresseEnt = $ad1Ent." ".$ad2Ent." ".$cpEnt." ".$villeEnt;

$entreprise = new Entreprise(-1, $nomEnt, $adresseEnt, $mailEnt, $telEnt);

$entreprise->ajouter();


 //R�cup�ration des infos Stage

$dateDebut = $_POST['fldds'];
$nvRequis = $_POST['flniv'];
$dureeStage = $_POST['flduree'];
$competence = $_POST['flcompt'];
$remuneration = $_POST['flrenum'];
$missionStage = $_POST['flmiss'];

//Cr�ation de l'objet Offre

$offre = new Offre(-1,$dateDebut,$dureeStage,$competence,$nvRequis,$missionStage,$entreprise);

if($remuneration != null)
	$offre->setRemuneration($remuneration);
	
$offre->ajouter();



?>

<script type="text/javascript">

window.location.replace("index.php?valide=1");
	
</script>

</body>
</html>
